var popupStatus = 0;
var send_reservation = 0;
//loading popup withwith  jQuery magic!
function loadPopup(){
  //팝업은 popupStatus 가 비활성화되어 있을때만 불러진다.불러진다. / loads popup only if it is disabled
  if(popupStatus==0){
    $("#backgroundPopup").css({
     "opacity": "0.7"
   });
   $("#backgroundPopup").fadeIn("slow");
   $("#popupContact").fadeIn("slow"); $("#popupContact").fadeIn("slow");
      popupStatus = 1;
    }
}
//disabling  popup with jQuery magic!
function disablePopup(){
	//popupStatus 가 활성화 되어 있다면있다면 비활성화 시키기 / disables popup only if it is enabled
	if(popupStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popupStatus = 0;
	}
}
function centerPopup(){
  //화면 중앙에 자리잡게 하기 위한 요청 / requestrequest data for centering
  var windowWidth = document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;
  var windowHeight = document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;
  var popupHeight = $("#popupContact").height();
  var popupWidth = $("#popupContact").width();
  //중앙에 위치시키기 / centering
  $("#popupContact").css({
    "position": "absolute",
    "top": windowHeight/2-popupHeight/2,
    "left": windowWidth/2-popupWidth/2
  });
  //IE6 을 위한 핵 / only need force for IE6
  $("#backgroundPopup").css({
  	"width": windowWidth,
    "height": windowHeight
  });
}
$(window).resize(function() {
	centerPopup();
});
function showImage(src) {
	$('#popupImage').load(function() {
		centerPopup();
		loadPopup();
	});
	$('#popupImage').attr('src',src);
}